<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Produits</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>

	<div>
		<s:form action="save" method="post">
			<s:textfield key="reference.label" name="produit.reference" />
			<s:textfield key="designation.label" name="produit.designation" />
			<s:textfield key="prix.label" name="produit.prix" />
			<s:textfield key="quantite.label" name="produit.quantite" />
			<s:checkbox key="promo.label" name="produit.promo" />
			<s:hidden name="editMode" />
			<s:submit value="Save" />
		</s:form>
	</div>

	<div>
		<table class="table1">
			<tr>
				<th>REFERENCE</th>
				<th>DESIGNATION</th>
				<th>PRIX</th>
				<th>QUANTITE</th>
				<th>PROMO</th>
			</tr>
			<s:iterator value="produits">
				<tr>
					<td><s:property value="reference" /></td>
					<td><s:property value="designation" /></td>
					<td><s:property value="prix" /></td>
					<td><s:property value="quantite" /></td>
					<td><s:property value="promo" /></td>
					<s:url namespace="/" action="delete" var="lien1">
						<s:param name="ref" value="reference" />
					</s:url>
					<s:url namespace="/" action="edit" var="lien2">
						<s:param name="ref" value="reference" />
					</s:url>
					<td><s:a href="%{lien1}">Supprimer</s:a></td>
					<td><s:a href="%{lien2}">Editer</s:a></td>
				</tr>
			</s:iterator>
		</table>
	</div>

</body>
</html>